
import { OrderitemEntity } from './Orderitem';
import { xsEntity } from './commentity';
import { Column, Entity, OneToMany } from 'typeorm';

/**
 * 描述
 */
@Entity()
export class OrderEntity extends xsEntity {
    @Column({ comment: '描述', default: null })
    orderid: string;

    @Column({ comment: '描述', default: null })
    totalPrice: number;
    @Column({ comment: '0: 未完成;1:付款; 2:取消订单 ;3:完成;  4:退款 ', default: null })
    status: number;
    @Column({ comment: '取餐码 ', default: null })
    code: string;

    @Column({ comment: '收货地址 ', default: null })
    address: string;

    @Column({ comment: '区域', default: null })
    longitude: string;
    @Column({ comment: '区域', default: null })
    latitude: string;


    @Column({ comment: '子商品', default: null })
    goods: string;


    // 一对多

    @Column({ comment: '商家id', default: 1 })
    shop: string


    @OneToMany(type => OrderitemEntity, photo => photo.pid) // note: we will create author property in the Photo class below
    foodes: OrderitemEntity[];




    @Column({ comment: '备注', default: null })
    message: string





}
